package sga.gui.base;
import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JToolBar;
import javax.swing.JList;
import javax.swing.JTextField;

import javax.swing.JButton;

import sga.dominio.time.GrupoCopa;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;


public class TelaClassificacaoTimes extends JFrame {

	private JPanel contentPane;
	private JTextField textField;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTextField textField_3;
	private GrupoCopa Grupo;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					TelaClassificacaoTimes frame = new TelaClassificacaoTimes();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	// construtor vazio
	public TelaClassificacaoTimes(){}
	public TelaClassificacaoTimes(GrupoCopa grupo) {
		Grupo=(grupo);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		textField = new JTextField();
		textField.setBounds(10, 41, 273, 33);
		contentPane.add(textField);
		textField.setColumns(10);
		textField.setText(grupo.getListaTimes()[0].getNome()+" Pontos: "+grupo.getListaTimes()[0].getInfoTime().getPontos());
		
		textField_1 = new JTextField();
		textField_1.setColumns(10);
		textField_1.setBounds(10, 85, 273, 33);
		contentPane.add(textField_1);
		textField_1.setText(grupo.getListaTimes()[1].getNome()+" Pontos: "+grupo.getListaTimes()[1].getInfoTime().getPontos());
		
		textField_2 = new JTextField();
		textField_2.setColumns(10);
		textField_2.setBounds(10, 140, 273, 33);
		contentPane.add(textField_2);
		textField_2.setText(grupo.getListaTimes()[2].getNome()+" Pontos: "+grupo.getListaTimes()[2].getInfoTime().getPontos());
		
		textField_3 = new JTextField();
		textField_3.setColumns(10);
		textField_3.setBounds(10, 184, 273, 33);
		contentPane.add(textField_3);
		textField_3.setText(grupo.getListaTimes()[3].getNome()+" Pontos: "+grupo.getListaTimes()[3].getInfoTime().getPontos());
		
		JButton btnNewButton = new JButton("New button");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				Grupo.gerarClassificacaoGrupo();
				TelaTotalClass tela=new TelaTotalClass(Grupo);
				tela.setVisible(true);
			}
		});
		btnNewButton.setBounds(284, 46, 89, 23);
		contentPane.add(btnNewButton);
	}
}
